package io.renren.modules.statistis.service.impi;

import io.renren.modules.generator.entity.TObjectEntity;
import io.renren.modules.generator.entity.TTrainingScoreEntity;
import io.renren.modules.statistis.dao.statistisDao;
import io.renren.modules.statistis.service.statistisService;
import io.renren.modules.statistis.statistisEntity;
import io.renren.modules.user.entity.TPeopleEntity;
import io.renren.modules.user.entity.TPeopleFireDetachmentEntity;
import io.renren.modules.user.entity.vo.PeopleVo;
import io.renren.modules.user.entity.vo.PeopleZZVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;
import java.util.Map;

@Service("statistisService")
public class statistisServiceImpl implements statistisService {

    @Autowired
    private statistisDao statDao;

    /**
     * 测试
     * @return
     */
    @RequestMapping("getTest")
    public List<TObjectEntity> getTest(){
        return statDao.getTest();
    }

    /**
     * 按人员类型进行分类统计
     */
    public List<TPeopleEntity> getTPeople(statistisEntity read){
        return statDao.getTPeople(read);
    }
    /**
     *按下级部门进行分类统计
     */
    public List<TPeopleFireDetachmentEntity> getTPeopleFireDetachment(statistisEntity read){
        return statDao.getTPeopleFireDetachment(read);
    }
    /**
     * 人员自定义分析
     */
    public List<TPeopleEntity> getSelfEmployed(statistisEntity read){
        return statDao.getSelfEmployed(read);
    }
    /**
     * 人员衔级分布
     */
   public List<Map<String,Object>> getRyxjfb(PeopleVo peopleVo){
        return statDao.getRyxjfb(peopleVo);
    }

    /**
     * A．战斗类型统计
     */
   public List<Map<String,Object>> getZdlxtj(statistisEntity read){
       return statDao.getZdlxtj(read);
    }
    /**
     * B．下属单位战斗次数统计
     */
    public List<Map<String,Object>> getXsdwzdcstj(statistisEntity read){
        return statDao.getXsdwzdcstj(read);
    }
    /**
     * C．本年度战斗次数统计
     */
    public List<Map<String,Object>> getBndzdcstj(statistisEntity read){
        return statDao.getBndzdcstj(read);
    }
    /**
     * D．历史年份同月战斗次数类型统计
     */
    public List<Map<String,Object>> getLsnftyzdcslxtj(statistisEntity read){
        return statDao.getLsnftyzdcslxtj(read);
    }


    public List<PeopleZZVo> getRyhtfb(String parentId, String squadron) {
        List<PeopleZZVo> peopleZZList = statDao.getRyhtfb(parentId,squadron);
        return peopleZZList;
    }

    /**
     * 考核成绩 分布图
     */
   public List<TTrainingScoreEntity> achievementStatistics(statistisEntity read){
        return statDao.achievementStatistics(read);
    }
    /**
     * #下级单位考核合格率分析图
     */
   public List<TTrainingScoreEntity> passRateStatistics(statistisEntity read){
       return statDao.passRateStatistics(read);
   }
    /**
     * ############单位考核均值
     */
   public List<TTrainingScoreEntity> companyStatistics(statistisEntity read){
       return statDao.companyStatistics(read);
    }

    /**
     *#历史成绩曲线图
     */
   public List<TTrainingScoreEntity> historicalResultsStatistics(statistisEntity read){
        return statDao.historicalResultsStatistics(read);
    }
    /**
     * 自主 人员分布
     */
   public List<TPeopleEntity> peopleStatistics(statistisEntity read){
        return statDao.peopleStatistics(read);
    }
    /**
     * 人员参训情况统计分析
     */
   public List<TPeopleEntity> peopleJoinStatistics(statistisEntity read){
        return statDao.peopleJoinStatistics(read);
    }
    /**
     *人员带训情况
     */
   public List<TPeopleEntity> peopleUncommittedStatistics(statistisEntity read){
        return statDao.peopleUncommittedStatistics(read);
    }
    /**
     *人员战斗情况分析
     */
   public List<TPeopleEntity> fightPeopleStatistics(statistisEntity read){
        return statDao.fightPeopleStatistics(read);
    }

    public List<Map<String, Object>> findScoreDistribution(Integer trainingCheckId){
        return statDao.findScoreDistribution(trainingCheckId);
    }

    public List<Map<String, Object>> findDeptPassRate(Integer trainingCheckId){
        return statDao.findDeptPassRate(trainingCheckId);
    }
    public List<Map<String, Object>> findZdeptPassRate(Integer trainingCheckId,Integer parentId){
        return statDao.findZdeptPassRate(trainingCheckId,parentId);
    }
    public List<Map<String, Object>> findClassPassRate(Integer trainingCheckId,Integer parentId){
        return statDao.findClassPassRate(trainingCheckId,parentId);
    }

    public List<Map<String, Object>> findImportantTrainingPassTrend(Integer trainingId){
        return statDao.findImportantTrainingPassTrend(trainingId);
    }
    /**
     * 历史成绩曲线图
     */
    public List<Map<String, Object>> peopleHistoryScore(Integer peopleId){
        return statDao.peopleHistoryScore(peopleId);
    }
    /**
     * 能力分析雷达图
     */
    public List<Map<String, Object>> peopleAbilityAnalysis(Integer peopleId){
        return statDao.peopleAbilityAnalysis(peopleId);

    }
    /**
     * 个人考核指标成长曲线图
     */
    public List<Map<String, Object>> peoplePersonalGrowth(Integer peopleId,List<Integer> list){
        return statDao.peoplePersonalGrowth(peopleId,list);
    }
    /**
     * 人员成绩对比
     */
    public List<Map<String, Object>> personalScoreCompare(Integer trainingCheckId,List<Integer> list){
        return statDao.personalScoreCompare(trainingCheckId,list);
    }
    /**
     * 人员指标成绩对比
     */
    public List<Map<String, Object>> personalObjectScoreCompare( Integer peopleId,List<Integer> list){
        return statDao.personalObjectScoreCompare(peopleId,list);
    }
    /**
     * 单位平均成绩
     */
    public List<Map<String, Object>> detachmentScoreCompare(Integer trainingCheckId,List<Integer> list){
        return statDao.detachmentScoreCompare(trainingCheckId,list);
    }
    /**
     * 单位指标成绩对比分析
     */
    public List<Map<String, Object>> detachmentObjectScoreCompare(List<Integer> detachmentList,List<Integer> objectList){
        return statDao.detachmentObjectScoreCompare(detachmentList,objectList);
    }
    /**
     * 根据考核ID查人员
     */
    public List<Map<String, Object>> selectPeopleByCheckId(Integer trainingCheckId){
        return statDao.selectPeopleByCheckId(trainingCheckId);
    }
    /**
     * 根据考核ID查单位
     */
    public List<Map<String, Object>> selectDetachmentByCheckId(Integer trainingCheckId){
        return statDao.selectDetachmentByCheckId(trainingCheckId);
    }
}
